let chren = args.form;
for(let item of chren){
    let id = item.id;
    lib.dbUpdate(`UPDATE inventory i
LEFT JOIN adjustment_order_product aop ON i.id = aop.inventory_id 
SET i.availble_num = (
	IF
		( i.availble_num IS NULL, 0, i.availble_num ) +
	IF
	( aop.good_adjust_num IS NULL, 0, aop.good_adjust_num )),
	i.defective_quantity = (
	IF
		( i.defective_quantity IS NULL, 0, i.defective_quantity ) +
	IF
	( aop.bad_adjust_num IS NULL, 0, aop.bad_adjust_num )) 
WHERE
	aop.id = ?  
	AND i.del_flag = 0 
	AND aop.del_flag = 0`,id)
}
1